"use strict";

const axios = require("axios");

const BASE_URL = process.env.CLI_REQUEST_BASE_URL;

const request = axios.create({
  baseURL: BASE_URL,
  timeout: 5000
});

request.interceptors.response.use(
  response => {
    return response.data;
  },
  error => {
    return error.data;
  }
);

module.exports = request;
